/**
 * Created by sdh on 2017/4/21.
 */
    var regApp = angular.module('regApp',[]);
    regApp.controller("regCtrl",function($scope,$http){
        $scope.processRegForm = function(isVaild){
            if(isVaild){
                $http({
                    method:'POST',
                    url:'/reg',
                    data: $.param($scope.regFormData),
                    headers:{'Content-Type':'application/x-www-form-urlencoded'}
                }).success(function(data){
                    if (data === "success") {
                        alert("注册成功,您现在可以登录!")
                        window.location = "/login";
                    } else {
                        alert(data);
                    }
                })
            }
        }
    })
